package cn.java.exercises;

public class Dog
{
    private String strName;
    private int    nAge;
    private String strType;
    private String strColor;

    public Dog()
    {
        strName="美美";
        nAge=2;
        strType="牧羊犬";
        strColor="白色";
    }

    public Dog(String strName,int nAge,String strType,String strColor)
    {
        this.strName=strName;
        this.nAge=nAge;
        this.strType=strType;
        this.strColor=strColor;
    }

    public void printDogInfo()
    {
        String strInfo=String.format("狗名:%s,年龄:%d,品种:%s,颜色:%s",strName,nAge,strType,strColor);
        System.out.println(strInfo);
    }

    public static void main(String[] args)
    {
        Dog dog=new Dog();
        dog.printDogInfo();
        dog=new Dog("来福",3,"拉布拉多","黑色");
        dog.printDogInfo();
    }
}
